home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
SPACE 1
/
SPACE - Library 1 - Volume 1.iso
/
program
/
386
/
assemblr
/
assemble.asc
< prev
Wrap
Text File
|
1993-01-01
|
13KB
|
315 lines
*****************************************************************
This assembler is Public Domain from West Germany and is free to
be copied and shared as long as it is not sold and this
documentation remains with it. The author is:
Eckhard Kruse
Reichenbergweg 7
3302 Weddel
West Germany
The program was imported translated from the original german by:
Robert Zimmerer
131 W 2nd St.
Port Angeles, WA. 98362
(206) 452-7529
For more information about this and other software available from
germany, write or call me. *See adendum
*****************************************************************
Description of this Assembler
(2 pass assembler, disassembler, editor, debugger)
General overview
1. This assembler allows the construction of machine language
programs with the use of the general 68000 command set. It is
line oriented and can process data that is prepared with a
different editor. It was designed for simple operation during
programming. The assembler remains in memory along with the
program being written and can be immediately called up or tested.
2. The assembler was written for medium and high resolutions.
If it is used in low resolution, undesirable effects may occur.
(especially during editing)
3. The maximum program size is 30000 lines; providing that you
have reserved enough space for the listing, labels and the
assembled program. Immediately after loading, the free memory
space is shown and you may allocate space for the three areas
according to your needs. As a rule you may ignore this
installation proceedure and use the default settings by pressing
<Return>. Keep in mind, though, ther is no error message given if
you should run out of space. (this can cause loss of data)
4. The assembler distinguishes between UPPER and lower case text
only btween quotation marks. On the other hand this is the case
when you define strings with: DC, or when you want to list from a
label using: LIST "LABEL".
Direct commands
After loading the assembler and allocating the memory, you
are in Direct Mode. You now have a list of commands at your
disposal which are sorted and explained by function:
Commands for handling the program listing:
ADD - Append lines to the end of the program; if no program is in
memory, a new one is created.
E, EDIT [Ln#, Ln#] - Edit or change lines. Allows parameters for
beginning and ending line # to edit [not necessary]. If you
enter a string or label in quotation marks, editing will
begin at the line which starts with this string.
INS [Ln#] - Insert a line before the given line #.
DEL [LN#, Ln#] - Delete or erase lines. The parameters for this
command operate like EDIT.
COPY Ln#, Ln# TO Ln# - Copies the lines specified before TO
inserting them directly above the line # given after TO.
L, LIST [Ln#, Ln#] - List the program.
FIND "String" [Ln#, Ln#] - Search for the specified string in the
listing.
NEW - Delete the program.
Commands for assembly and starting the program:
ASM [F] - Assembles the listing into a runnable program in memory.
When you type F, the listing isn't shown during assembly.
PRGASM [F] - Assembles the listing into a program that can be
saved with PRGSAVE.
LABEL [Adr/Label] - Shows all labels with their addresses. If you
enter a label or address, the others won't be shown.
GO Adr/Label - Lets you call up your program by entering the
starting address or label.
TRACE Adr/Label - Use like GO. Trace shows the register contents
and flags after each machine language command.
Commands for storing and loading:
DIR [Filespec] - Show directory. Wildcards are allowed, *.* is
the default.
PATH [Drive:]Pathname - Change or specify the drive and pathname.
SAVE Filename - Saves the program specified.
LOAD Filename - Loads the program specified.
MERGE Filename - Append specified program to end of the one in
memory.
BSAVE Adr, Length, Filename - Save part of the listing to
Filename.
BLOAD ADR, Filename - Load a file into the program in memory at
the address given.
PRGSAVE Filename - Must follow PRGASM. Saves the assembled
program as executable from the desktop.
Printer control:
PON - Turns printer on: everything printed to screen is sent to
the printer.
POFF - Turns printer off.
Other commands:
DUMP Adr/Label - Lists memory contents.
DIS Adr/Label - Disassembles memory from the specified address.
= / DECHEX Exp. - Shows the expression [calculations, labels...]
in hexidecimal and decimal.
!Opcode - Allows testing of machine language commands. [eg. !CLR.B
[A0]+ ] The effects can be checked with REG.
REG - All the register contents are saved after every call from
GO, TRACE & !Opcode. REG displays them.
PMREG - When the system "locks up", the last contents of the
register are always saved and remain after a reset. PMREG
displays these values.
QUIT - Leave the assembler and return to the desktop.
Assembler commands:
As stated before, the commands follow the general rules for
the most part. A few of the peculiarities are:
1. The assembler demands clearly formulated commands. A few
examples: Try typing ADDA A0, A1 instead of ADD A0, A1; CMPI #5,
[A1] instead of CMP #5, [A1] etc.
2. The word lengths are, like normal, identified by the
extension ".B", ".W" or ".L" after the commands. If only one
length is allowed or ".W" is desired you can forego any extension.
When addressing 'Address registers indirectly with Index and
Distance' you have to give the length. [eg. ...0[A0, D0.W] ]
3. Short Branch-commands jump between -128 and 126 should be
marked by a ".S" extension, otherwise they won't be recognized as
short commands.
4. The assembler doesn't accept the mneumonic "SP" [Stack
Pointer]. Use "A7" instead.
5. There are additionally the commands SAVEALL and LOADALL;
short for MOVEM.L D0-A6,-[A7] & MOVEM.L [A7]+,D0-A6. Mnemonics
are likewise at your disposal for the LINE A-Command:
A_INIT = $A000, A_PUPIX = $A001, A_GEPIX = $A002, A_LINE = $A003,
A_HOLIN = $A004, A_RECT = $A005, A_POLY = $A006, A_BTBLT = $A007,
A_TXBLT = $A008, A_SHMOU = $A009, A_HICUR = $A00A, A_TRMOU = $A00B,
A_UNSPR = $A00C, A_DRSPR = $A00D, A_COPRF = $A00E
Pseudo Ops:
You can make use of more instructions in the listing along
with the assembler commands:
1. Comments must begin with a semicolon or asterisk. It isn't
neccessary to seperate the asterisk from the commands.
2. The command DC [.DC is also allowed] defines a row of bytes,
words or longwords [dependent on .B, .W, .L]. Text must be
enclosed in either single or double quotation marks. Those with
.W and .L get a null byte added to them in order to make the next
address even. By using an exclaimation point, you can combine a
chain of bytes or words into a longword. [eg. DC.B 1,2,!LABEL,..]
3. You can reseve memory with DS [or .DS]. You can also use .B,
.W and .L here.
4. The command .EVEN assures that the next address worked on
will be even.
5. If you want to create an executable program [with PRGASM and
PRGSAVE], you have to decide between three sections: one for the
program, one for intialized data and one for uninitialized data.
This assembler demands that these blocks appear in the listing in
the named order. In order to identify them write .DATA at the
beginning of the defined data and .BSS at the beginning of the
undefined.
Labels:
You can use labels of course. They must begin immediately at
the start of the line, in contrast to the assembler commands which
must be at least one space from the beginning of the line. There
is no limit to the length of the labels, although only the first
10 characters are significant. Labels may not end with a colon.
Editing:
When issuing direct commands or editing lines you should keep
the following in mind:
The editing line is 72 characters long, if you exceed this
the cursor will move back to the beginning of the line.
The arrow keys move the cursor to the left and right. The
<Clr Home> key will erase the entire line. To insert or delete
spaces, use the <Ins>, <Delete> and <Backspace> keys.
Press <Return> to end the input. To ignore the changed
lines, press <Undo>. (With EDIT, INS and ADD you will
automatically return to the direct mode.)
It should also be mentioned here that you may pause a listing
by pressing the space bar, and cancel it with the <Return> key.
Number system:
Anywhere that you enter values (in the assembler listing or
in direct mode) you may choose from the following representations:
Decimal : (+/-)xxxx
Hexadecimal : (+/-)$xxxx
Binary : (+/-)%xxxx
Label : LABEL
Character : 'c
String (up to 4 characters) : "cccc"
Otherwise you can connect several values together with the symbols
+, -, * and / (with the exception of characters and string
values). These symbols don't follow the normal mathematical
rules, but instead the results are calculated from right to left!
(eg. instead of (b-c)*a, write a*b-c).
(This is certainly an unusual and complicated style. I decided
that since the usual operation only requires a simple addition or
subtraction (as a rule), I would save myself the trouble of
rewriting the program for this one oversight.)
Error Messages:
Several errors can occur during assembly or direct input. In
such a case there will be a bell sound and the error message will
appear, stopping the assembly. There is no guarentee that the
assembler will catch every error, but in most cases this problem
won't arrise. [If you are uncertain, you can disassemble the
questionable section.]
Here are the error messages and their meanings:
Illegal opcode : Unknown command appeared during assembly.
Undefined error : Unable to identify error further.
Wrong adressing mode: Present addressing mode con't be used here.
Unknown adr. mode : Addressing mode doesn't exist.
Undefined label : Label must be previously defined.
Syntax : Direct mode input error.
File not found : The file doesn't exist.
Double def. label : Label defined twice.
Illegal reg # : Wrong number entered for an address- or data
register. [0-7 are allowed]
Adr. out of range : Branch command to address not in it's range.
Can also occur when a Branch.S command tries
to jump directly to the next address.
Value out of range : Value won't fit into chosen word length.
Abort : User induced interuption.
Illegal word size : Missmatched word size for command.
Printer not on line : Printer isn't plugged in or is off.
Unknown word size : Word size other than .B, .W or .L was used.
No data register : Data register required with this command.
Disk: -xx : Diskerror #xx occured.
-----------------------------------------------------------------
Translater's adendum:
This program, as I mentioned above, is Public Domain software
from West Germany. I imported and translated it and consequently
cannot be held responsible for any damages or unforseen
consequences that may be encountered due to its use.
This program in its original form including the German
documentation and my most recent translation may be ordered for
only $5.50 (to cover disk, translating, shipping and handling
costs). Send your order to:
Robert Zimmerer
131 W 2nd Street
Port Angeles, WA 98362
If you are interested in other programs from Germany, write
or call for more information. My # is:
(206) 452-7529